package com.chengqs.jvm.t3.bytecode;

public class Demo3_12_2 {
    public static void main(String[] args) {
        // int result = test1();
        User result = test2();
        System.out.println(result.name);
    }

    public static int test1() {
        int i = 10;
        try {
            return i;
        } finally {
            i = 20;
        }
    }

    public static User test2() {
        User u = new User();
        try {
            return u;
        } finally {
            u.name = "zhangsan";
        }
    }

    public static class User {
        public String name = "lisi";
    }
}
